﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="Photos.aspx.cs" Inherits="Framework.WebmasterTool.Comments.Photos" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
            $("#<%= btnDelete.ClientID %>").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                function (r) {
                    if (r) {
                        __doPostBack(callFrom.attr('name').replace(/_/g, '$'), '');
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Quản lý bình luận bài viết hình ảnh
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <br />
        <table width="750" align="center">
            <tr>
                <td>
                    <table width="100%">
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnCommentArticle" runat="server" Text="Quản lý bình luận bài viết"
                                    OnClick="btnCommentArticle_Click" />
                                <asp:Button ID="btnCommentProduct" runat="server" Text="Quản lý bình luận sản phẩm"
                                    OnClick="btnCommentProduct_Click" />
                                <asp:Button ID="btnCommentVideo" runat="server" Text="Quản lý bình luận video" OnClick="btnCommentVideo_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td width="35%">
                            </td>
                            <td align="right">
                                <span style="font-weight: bold">Tìm kiếm: </span>
                                <asp:TextBox ID="txtSearch" runat="server" ValidationGroup="Search" Width="200" />
                                <asp:Button ID="btnSearch" runat="server" ValidationGroup="Search" Text="Search"
                                    OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="right" style="font-weight: bold">
                    Tổng số bình luận bài viết hình ảnh:
                    <asp:Label ID="lblTotalCommentPhoto" runat="server" Font-Bold="true" ForeColor="red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-top: 5px;">
                    <asp:GridView runat="server" Width="100%" CssClass="grid" ID="grvCommentPhoto" AutoGenerateColumns="false"
                        AllowPaging="true" PageSize="10" AllowSorting="true" ToolTip="all" OnDataBinding="grvCommentPhoto_DataBinding"
                        OnPageIndexChanging="grvCommentPhoto_PageIndexChanging" OnSorting="grvCommentPhoto_Sorting">
                        <Columns>
                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                <HeaderTemplate>
                                    <input id="chkAll" type="checkbox" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("CommentID") %>' />
                                </ItemTemplate>
                                <HeaderStyle Width="20px" />
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày tháng" SortExpression="AddedDate" HeaderStyle-Width="200"
                                ItemStyle-Width="200" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                <ItemTemplate>
                                    <asp:HiddenField ID="hidfAddedDate" runat="server" Value='<%# Eval("AddedDate") %>' />
                                    <a href="<%= DGSFramework.Globals.ApplicationPath %>WebmasterTool/Comments/PhotoEdit.aspx?CommentID=<%# Eval("CommentID") %>">
                                        <%# String.Format("{0:dd/MM/yyyy HH:mm:ss tt}", (DateTime)(Eval("AddedDate")))%></a>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" Width="200" />
                                <ItemStyle HorizontalAlign="Left" Width="200" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tên bài viết" SortExpression="TitleArticle" HeaderStyle-Width="300"
                                ItemStyle-Width="300" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                                <ItemTemplate>
                                    <a href="<%= DGSFramework.Globals.ApplicationPath %>WebmasterTool/Photos/PhotoAdd.aspx?PhotoID=<%# Eval("PhotoID") %>">
                                        <%# Eval("TitlePhoto") %></a>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Left" Width="300" />
                                <ItemStyle HorizontalAlign="Left" Width="300" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Đánh giá" SortExpression="Levels" HeaderStyle-HorizontalAlign="Center"
                                ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <img src='<%= DGSFramework.Globals.ApplicationPath %>WebmasterTool/Images/level<%# Eval("Levels") %>.png'
                                        alt="" />
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Duyệt" SortExpression="IsActive" HeaderStyle-Width="50"
                                ItemStyle-Width="50" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkIsActive" runat="server" Checked='<%# Eval("IsActive") %>' Enabled="false" />
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center" Width="50" />
                                <ItemStyle HorizontalAlign="Center" Width="50" />
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <table align="center" width="300" border="0">
                                <tr>
                                    <td height="50" align="center">
                                        <div align="center">
                                            Không có dữ liệu
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <PagerSettings Mode="NumericFirstLast" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <br />
                    <asp:Button runat="server" ID="btnDelete" Text=" Xoá các bình luận đã chọn " OnClick="btnDelete_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>